package com.wulian.utils;

import java.util.Random;

/**
 * @author xf
 * @date 2021/3/21 下午 2:39
 * @Description
 */
public class RandomUtil {

    public static String getFourRandom(){
        Random random = new Random();
        String fourRandom = random.nextInt(10000) + "";
        Integer length = fourRandom.length();
        if (length<4){
            for (int i = 1; i < 4-length; i++) {
                fourRandom = "0"+fourRandom;
            }
        }
        return fourRandom;
    }
}
